package com.fy.sys.controller;

import com.fy.core.vo.ApiRest;
import com.fy.sys.service.DeptService;
import com.fy.sys.vo.DepartTreeVo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;

/**
 * <p>
 * 部门表 前端控制器
 * </p>
 *
 * @author hxd
 * @since 2023-06-15
 */
@RestController
@CrossOrigin
@RequestMapping("/dept")
public class DeptController {
    @Autowired
    private DeptService deptService;
    @GetMapping("tree")
    public ApiRest<List<DepartTreeVo>> tree(){
        return deptService.findDepartCascade();
    }
}
